﻿@using CoralNode.Core.Entity.Domains.Prototype
@using CoralNode.MvcClient.Helper
@model CoralNode.Core.Entity.SearchQuerys.Prototype.PrototypeCategorySearchQuery

@{
    ViewBag.Title = "Index";
    ViewData["curr"] = "category";
}

@Html.IncludePage("CoralAdmin/prototype", "_Left", new { current = "prototype" })
<!--content-->
<div id="pbody">
    <div class="extra">
        <div class="pbody_top">
            <span class="ico ico_setting_system"></span><span class="t t_c">内容设计&nbsp;&nbsp;/&nbsp;&nbsp;<b
                class=" t_small f_no">原型管理</b></span>
        </div>
        <div id="main">
            @Html.IncludePage("CoralAdmin/Prototype","_tab",new{prototypeId=ViewBag.Prototype.Id})
            <div class="">
                <div class="tablelist_style1" data-js="tabellist_style1">
                    <div class="funsearch p_1 pl_2 pr_2 extra_normal">
                        <div class="select_owner w_12-5 " data-meta="{value:'@ViewBag.Prototype.Id', btn:'<span class=\'ico ico_slide_down\'></span>' , clickbtn:'<span class=\'ico ico_slide_up\'></span>'}">
                            <ul>
                                @foreach (var item in @ViewBag.PrototypeList)
                                {
                                    if (@item.Id == @ViewBag.Prototype.Id)
                                    {
                                        <li data-value="@item.Id"><a class="current" href="/m/prototype/listCategory?PrototypeId=@item.Id">@item.Title</a></li>
                                    }
                                    else
                                    {
                                        <li data-value="@item.Id"><a  href="/m/prototype/listCategory?PrototypeId=@item.Id">@item.Title</a></li>
                                    }
                                }
                            </ul>
                        </div>
                        <a class="btn_5 f_r ml_3" href="/m/prototype/batchCreateCategory?prototypeId=@ViewBag.Prototype.Id">批量添加</a>
                        <a class="btn_5 f_r ml_3" href="/m/prototype/createCategory?prototypeId=@ViewBag.Prototype.Id">添加分类</a>
                        <div class="f_r">
                            <form method="POST" action="/m/prototype/listCategory">
                                <span class="t_des f_l pt_0-5">分类名称：</span>
                                <label class="search f_l">
                                    @Html.TextBoxFor(m => m.Title, new { @class = "text w_18", @msg = "请输入关键字" })
                                    @Html.AntiForgeryToken()
                                    <input type="submit" value="" class="submit" /></label>
                            </form>
                        </div>
                    </div>
                    <table cellpadding="0" cellspacing="0">
                        <tr class="exclude">
                            <th width="60">选择</th>
                            <th width="50" align="left">ID</th>
                            <th align="left">名称</th>
                            <th width="80">排序</th>
                            <th width="60">状态</th>
                            <th width="140">操作</th>
                        </tr>
                        @foreach (PrototypeCategoryDomain item in ViewBag.CategoryList)
                        {
                            <tr data-depth="@item.Path">
                                <td>
                                    <label class="checkbox_own">
                                        <input type="checkbox" value="@item.Id"/></label></td>
                                <td class="td_left">@item.Id</td>
                                <td class="td_left">
                                    @if (@item.ParentId > 0)
                                    {
                                        <span class="ico ico_child ml_@item.Path"></span><a href="/m/prototype/editCategory/@item.Id">@item.Title</a>
                                    }
                                    else
                                    {
                                        <a href="/m/prototype/editCategory/@item.Id?PrototypeId=@item.PrototypeId">@item.Title</a>
                                    }
                                </td>
                                <td><a href="/m/prototype/ChangeCategoryRank/@item.Id" class="ico ico_moveup mr_2 f_no  btn"></a><a href="/m/prototype/ChangeCategoryRank/@item.Id" class="ico ico_movedown btn"></a>
                                </td>
                                <td><a class="ico ico_eye_close js_changestate btn"></a></td>
                                <td>
                                    <div class="fun">
                                        <a href="/m/prototype/editCategory/@item.Id?PrototypeId=@item.PrototypeId">编辑</a><a href="/m/prototype/deleteCategory/@item.Id" class="js_delete">删除</a>
                                    </div>
                                </td>
                            </tr>
                        }
                    </table>
                    <div class="global_fun ">
                        <label class="checkbox_own gloabal_select">
                            <input type="checkbox" /></label>
                        <input type="button" class="btn_4 btn invert" value="反选" /><input type="button" class="btn_4 btn reset"
                                                                                          value="重置" />
                        <a href="#" class="js_delete">删除</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
